#include <stdio.h>
#include <string.h>
#include <stdlib.h>
const int N = 110;

int main()
{
    char c;
    char d;
    char s[N] = { 0 };
    scanf(" %c", &c);
    scanf("%c", &d);
    fgets(s, 100, stdin);
    int n = strlen(s)-1;
    int flag = 1;
    for (int i = n - 1; i >= 0; i--)
    {
        if (s[i] == c)
        {
            flag = 0;
            printf("%d", i);
            break;
        }
    }
    if (flag)
        printf("Not Found");


}
